<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <!-- 开发环境版本 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    <input type="text" v-model="itemvalue">
    <button @click="addItem">添加</button>
    <hr/>
    <ul>
        <li v-for="item in items">{{item}}</li>

    </ul>
</div>
</body>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            itemvalue: '',
            items: ['学习Vue', '学习Django基础', '学习Django前台'],
        },
        methods: {
            addItem: function () {
                //把输入的数据 添加到items里去
                this.items.push(this.itemvalue)
                //清空输入框
                this.itemvalue = ''
            }

        }
    })
</script>
</html>